package com.example.back.jpa;

import java.util.List;

import com.example.common.entity.RxDrugs;
import com.example.common.entity.RxInfo;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.javers.spring.annotation.JaversSpringDataAuditable;

@JaversSpringDataAuditable
public interface RxDrugsRepository extends JpaRepository<RxDrugs, Long> {
    @Query(value = "select * from order_rx_drugs where rx_order_no_nvarchar = ?1",nativeQuery = true)
    List<RxDrugs> findByRxOrderNO(String RxOrderNO);

    @Query(value = "select * from order_rx_drugs where d_type_tinyint = 2 and rx_order_no_nvarchar in (:RxOrderNOs)",nativeQuery = true)
    List<RxDrugs> findByRxOrderNOs(@Param("RxOrderNOs") List<String> RxOrderNOs);

    @Query(value = "select * from order_rx_drugs where rx_order_no_nvarchar = ?1 and d_type_tinyint = 2",nativeQuery = true)
    List<RxDrugs> GetxdList(String rxorderno);
    
}
